<?php
/**
 * Created by PhpStorm.
 * User: zzw
 * Date: 17-4-13
 * Time: 下午3:07
 */
if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class History_model extends MY_Model {
    protected $table = 'history';
    public function dels($ids,$where=FALSE,$table=FALSE){
        if (!$table) {
            $table = $this->table;
        }
        if (is_numeric($ids)) {
            $this->db->where(array('id'=>$ids));
        }

        if (is_array($ids)) {
            $this->db->where_not_in('id',$ids);
        }

        if ($where) {
            $this->db->where($where);
        }

        $this->db->delete($table);

        return $this->db->affected_rows();
    }
}